package com.mhy.anno.service.impl;

import com.mhy.anno.mapper.BookMapper;
import com.mhy.anno.service.BookService;
import lombok.Setter;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.sql.DataSource;
import java.sql.SQLException;

@Service("bookService")
//@Setter
@ToString
public class BookServiceImpl implements BookService {


    @Autowired

    BookMapper bookMapper;
    @Value("${user.name}")
    String name;


//    public void setBookMapper(BookMapper bookMapper) {
//        this.bookMapper = bookMapper;
//    }

    //BookMapper bookMapper = new BookMapperImpl();
    //BookMapper bookMapper2 = new BookMapperImpl2();
    @Override
    public void queryBook() throws SQLException {
        System.out.println(this.name);
        System.out.println("booksss");
        String res = bookMapper.selectById(1);
        System.out.println(res);

    }
}
